﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Tradex.Messaging {

    /// <summary>
    /// This is a Pong message, which should be returned from the target endpoint in reply to a Ping.
    /// </summary>
    public class Pong : Message {

        /// <summary>
        /// The internal constructor.
        /// </summary>
        /// <param name="ping"></param>
        /// <param name="timeStamp"></param>
        internal Pong(Ping ping, DateTime timeStamp) {
            PingTimestamp = ping.PingTimestamp;
            PongTimestamp = timeStamp;
        }

        /// <summary>
        /// This is the internal timestamp of the Ping creation. The receiving Port can thus see how long the
        /// Ping was queued up before it was processed (and use this informnation to know whether it falls behind).
        /// </summary>
        internal DateTime PingTimestamp { get; private set; }

        /// <summary>
        /// This is the internal timestamp of the Pong creation. The receiving Port can thus see how long the
        /// Pong was queued up before it was processed (and use this informnation to know whether it falls behind).
        /// </summary>
        internal DateTime PongTimestamp { get; private set; }

    }
}
